package com.atguigu.srb.core.hfb;

import com.atguigu.service.base.utils.Amount1Helper;
import com.atguigu.service.base.utils.Amount2Helper;
import com.atguigu.service.base.utils.Amount3Helper;
import com.atguigu.service.base.utils.Amount4Helper;

import java.math.BigDecimal;
import java.util.Map;

public class CoreUtils {
    public static void initPerMonthMap(Map<Integer, BigDecimal> perMonthPrincipal, Map<Integer, BigDecimal> perMonthInterest,
                                BigDecimal amount , BigDecimal  yearRate , Integer period, Integer returnMethod) {
        switch (returnMethod) {
            case 1:
                perMonthPrincipal = Amount1Helper.getPerMonthPrincipal(amount, yearRate, period);
                perMonthInterest = Amount1Helper.getPerMonthInterest(amount, yearRate, period);
                break;
            case 2:
                perMonthPrincipal = Amount2Helper.getPerMonthPrincipal(amount, yearRate, period);
                perMonthInterest = Amount2Helper.getPerMonthInterest(amount, yearRate, period);
                break;
            case 3:
                perMonthPrincipal = Amount3Helper.getPerMonthPrincipal(amount, yearRate, period);
                perMonthInterest = Amount3Helper.getPerMonthInterest(amount, yearRate, period);
                break;
            default:
                perMonthPrincipal = Amount4Helper.getPerMonthPrincipal(amount, yearRate, period);
                perMonthInterest = Amount4Helper.getPerMonthInterest(amount, yearRate, period);
                break;

        }
    }

}
